package joapp

var runnableInstance any

type iStart interface {
	Start()
}

type iStartRspError interface {
	Start() error
}

func startRunApp(runnable any) {
	if r, ok := runnable.(iStart); ok {
		r.Start()
	}

	if r, ok := runnable.(iStartRspError); ok {
		if err := r.Start(); err != nil {
			panic(err)
		}
	}
}

func runJoAppImpl(runnable any) {
	runnableInstance = runnable
	startRunApp(runnable)
}
